/* 
 * File:   Lecturer.h
 * Author: user
 *
 * Created on July 26, 2014, 11:41 AM
 */

#ifndef LECTURER_H
#define	LECTURER_H

//#include <vector>
#include "User.h"
#include "ExamTopic.h"
//#include "TestQuestion.h"

class Lecturer : public User {
public:
    Lecturer();
    Lecturer(string userID);
    Lecturer(ExamTopic examTopic);
    Lecturer(const Lecturer& orig);
    
    void setExamTopic(ExamTopic examTopic);
    bool addExamTopic(string topic,string desc,string createBy);
    bool addQuestion2ExamTopic();
    bool updateExamTopic(int topicID, string column, string newValue,string createBy);
    bool deleteExamTopic(int topicID,string createBy);
    bool updateQuestion(int questionID, string column, string newValue,string examTopic);
    
    virtual ~Lecturer();
private:
    ExamTopic _examTopic;
   
    void printMenu();
    bool menuAction(int iSelection,bool& isExitProgram, int& loginStatus);
    //Display all exam topic created by lecturer
    bool displayExamTopic(bool queryQuestion = false);
    //Display all Question under the Exam topic
    bool displayQuestion(string topic, int viewType);
    
    void promptUserForAddingExamTopic();
    void promptUserForAddingQuestion2ExamTopic();
    
    bool promptUserForUpdateExamTopic(string& column, string& newValue);
    
    bool promptUserForDeleteExamTopic();
    
    bool promptUserForUpdateQuestion(string& column, string& newValue);
    
    bool promptUserForSelectingExamTopic();
    bool promptUserForSelectingQuestion();
    
    bool executeSql(const char* sql,string table);
    static int querryCallBack_ExamTopic(void *data, int argc, char **argv, char **azColName);
    static int querryCallBack_Question(void *data, int argc, char **argv, char **azColName);
    static int querryCallBack_TestSummary(void *data, int argc, char **argv, char **azColName);
    
    void updateExamObject();  
    
    bool extractTestSummary(string examTopic);

};

#endif	/* LECTURER_H */

